package com.gc.monitor;

import com.gc.monitor.gcexception.GCMonitorException;
import com.gc.monitor.gctask.GpsooMonitor;
import org.apache.log4j.Logger;

import javax.annotation.Resource;

/**
 * 监控脚本入口
 * Created by 瑱彬 on 2015/4/13.
 */
public class MonitorScript {
    Logger logger = Logger.getLogger(this.getClass());
    @Resource(name = "gpsooAnalysisHistory")
    private GpsooMonitor gpsooAnalysisHistory;
    @Resource(name = "gpsooLoadMonitor")
    private GpsooMonitor gpsooLoadMonitor;

    //    @Resource(name = "gpsooAnalysisAlert")
//    private GpsooMonitor gpsooAnalysisAlert;
    public void execute() {
        try {
            gpsooLoadMonitor.run();
            gpsooAnalysisHistory.run();
            //gpsooAnalysisAlert.run();
        } catch (GCMonitorException e) {
            logger.error(e.getMessage());
        }
    }
}
